#include <iostream>
#include <system_error>
#include "workerManager.h"

#include "worker.h"
#include "employee.h"
#include "manager.h"
#include "boss.h"
using namespace std;

int main(void)
{
    // 测试部分
    // Worker *worker = nullptr;
    // worker = new Employee(1, "安西",1);
    // worker->showInfo();
    // delete worker;

    // worker = new Manager(2, "本田",2);
    // worker->showInfo();
    // delete worker;

    // worker = new Boss(3, "森吉瑞",3);
    // worker->showInfo();
    // delete worker;


    WorkerManger wm;
    int choice;
    
    while(true)
    {
        wm.showMenu();
        cout << "请输入选择:" << endl;
        cin >> choice;
        switch(choice)
        {
            case 0:
                //退出系统
                wm.exitSystem();
                break;
            case 1:
                //添加职工
                wm.AddEmp();
                break;
            case 2:
                //显示职工
                wm.showEmp();
                break;
            case 3:
                //删除职工
                wm.DelEmp();
                break;
            case 4:
                //修改职工
                wm.modifyEmp();
                break;
            case 5:
                //查找职工
                wm.findEmp();
                break;
            case 6:
                //排序职工
                wm.sortEmp();
                break;
            case 7:
                //清空文档
                wm.cleanFile();
                break;
            default:
                system("cls");
                break;
        }
    }

    system("pause");
    return 0;
}